package com.hoshiibuy.goodsAllocation.entity.param;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import org.apache.commons.lang3.StringUtils;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hoshiibuy.common.query.CommonParam;
import com.hoshiibuy.goodsAllocation.entity.GoodsSubWarehouse;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * <p>
 * 查询商品分仓参数
 * </p>
 * 
 * @author Mr.Wu
 * @since 2019-04-28
 */
@Data
public class GoodsSubWarehouseQueryParam extends CommonParam implements Serializable {

	private static final long serialVersionUID = 1L;

	private Long id;

	@ApiModelProperty(value = "总仓id")
	private Long genId;

	@ApiModelProperty(value = "skuid")
	private Long skuid;

	@ApiModelProperty(value = "分仓类型（1-严选仓2-好获仓3-线下分销）")
	private Boolean type;

	@ApiModelProperty(value = "分仓名称")
	private String subname;

	@ApiModelProperty(value = "库存")
	private Integer stock;

	@ApiModelProperty(value = "建议零售价")
	private BigDecimal salePrice;

	@ApiModelProperty(value = "修改时间")
	private LocalDateTime updatetime;

	@ApiModelProperty(value = "修改人")
	private String updatedby;

	public QueryWrapper<GoodsSubWarehouse> getQueryWrapper() {
		QueryWrapper<GoodsSubWarehouse> queryWrapper = new QueryWrapper<GoodsSubWarehouse>();
		queryWrapper.eq(this.id != null, "id", this.id);
		queryWrapper.eq(this.genId != null, "gen_id", this.genId);
		queryWrapper.eq(this.skuid != null, "skuid", this.skuid);
		queryWrapper.eq(this.type != null, "type", this.type);
		queryWrapper.eq(StringUtils.isNotBlank(this.subname), "subname", this.subname);
		queryWrapper.eq(this.stock != null, "stock", this.stock);
		queryWrapper.eq(this.salePrice != null, "sale_price", this.salePrice);
		queryWrapper.eq(StringUtils.isNotBlank(this.updatedby), "updatedby", this.updatedby);
		return queryWrapper;
	}
}
